package com.xgg.taiwuinfo.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import java.util.List;
import java.util.Map;

public class SpinAdapter extends ArrayAdapter<String>
{
    public SpinAdapter(Context context , int resouce , List<Map<String, String>> arr)
    {
        super(context, resouce , new String[]{});
        m_list = arr;
        m_ctx = context;
    }

    private Context m_ctx;
    private List<Map<String, String>> m_list;

    @Override
    public String getItem(int pos){
        Map<String,String> obj = m_list.get(pos);
        return obj.get("f");
    }

    @Override
    public int getCount() {
        return m_list.size();
    }

    @Override
    public long getItemId(int position) {
        Map<String,String> obj = m_list.get(position);
        return Integer.parseInt(obj.get("v"));
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return super.getView(position , convertView , parent);
    }
}
